package com.home.model.enums;

public enum Gender {
	MALE(1), FEMALE(2), ORTHER(3);

	private int value;

	Gender(int value) {
		this.value = value;
	}

	/**
	 * convert value to Enum
	 * 
	 * @param value
	 * @return
	 */
	public static Gender parse(int value) {
		Gender gender = null;
		for (Gender item : Gender.values()) {
			if (item.getValue() == value) {
				gender = item;
				break;
			}
		}
		return gender;
	}

	public int getValue() {
		return value;
	}
}
